/*
 * Copyright 2010 Mttang.com All right reserved. This software is the
 * confidential and proprietary information of Mttang.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Mttang.com.
 */
package com.mttang.sys.biz.service.support;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.mttang.framework.core.service.AbstractService;
import com.mttang.sys.biz.service.MenuPrivilegeService;
import com.mttang.sys.dto.MenuPrivilegeDTO;
import com.mttang.sys.integration.dao.MenuPrivilegeDAO;
import com.mttang.util.SysBeanConstant;

/**
 * 类MenuPrivilegeServiceImpl.java的实现描述：TODO 类实现描述 
 * @author acc 2010-6-1 下午05:01:40
 */
public class MenuPrivilegeServiceImpl  extends AbstractService implements   MenuPrivilegeService{

    private Log logger = LogFactory.getLog(getClass());
    /* (non-Javadoc)
     * @see com.mttang.sys.biz.service.MenuPrivilegeService#delete(com.mttang.sys.dto.MenuPrivilegeDTO)
     */
    @Override
    public void delete(Map<String ,Object>  map) {
        // TODO Auto-generated method stub
        if (logger.isInfoEnabled()) {
            logger.info("---MenuPrivilegeServiceImpl---delete");
        }
        MenuPrivilegeDAO dao=(MenuPrivilegeDAO) context.getBean(SysBeanConstant.DAO_MENU_PRIVILEGE);
         dao.delete(map);
    }

    /* (non-Javadoc)
     * @see com.mttang.sys.biz.service.MenuPrivilegeService#findById(java.lang.Integer)
     */
    @Override
    public List<MenuPrivilegeDTO> findById(Integer menuId) {
        // TODO Auto-generated method stub
        if (logger.isInfoEnabled()) {
            logger.info("---MenuPrivilegeServiceImpl---findById");
        }
        MenuPrivilegeDAO dao=(MenuPrivilegeDAO) context.getBean(SysBeanConstant.DAO_MENU_PRIVILEGE);
        return dao.findById(menuId);
    }

    /* (non-Javadoc)
     * @see com.mttang.sys.biz.service.MenuPrivilegeService#insert(com.mttang.sys.dto.MenuPrivilegeDTO)
     */
    @Override
    public void insert(MenuPrivilegeDTO dto) {
        // TODO Auto-generated method stub
        if (logger.isInfoEnabled()) {
            logger.info("---MenuPrivilegeServiceImpl---insert");
        }
        MenuPrivilegeDAO dao=(MenuPrivilegeDAO) context.getBean(SysBeanConstant.DAO_MENU_PRIVILEGE);
         dao.insert(dto);
    }

    /* (non-Javadoc)
     * @see com.mttang.sys.biz.service.MenuPrivilegeService#insertMenu(com.mttang.sys.dto.MenuPrivilegeDTO)
     */
    @Override
    public void insertMenu(MenuPrivilegeDTO dto) {
        // TODO Auto-generated method stub
        if (logger.isInfoEnabled()) {
            logger.info("---MenuPrivilegeServiceImpl---insertMenu");
        }
        MenuPrivilegeDAO dao=(MenuPrivilegeDAO) context.getBean(SysBeanConstant.DAO_MENU_PRIVILEGE);
         dao.insertMenu(dto);
    }

}
